﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.ComponentModel;
using System.Collections.Generic;
namespace WPFExcelReport
{
    public partial class UIAE03 : ViewBase
    {
        public override void ManageCommand(object sender, RoutedEventArgs e)
        {
            if (!IsManage)
            {
                VICC_WFEVENTS.SVWF.AM02(this.RUNID);
            }

            base.ManageCommand(sender, e);
        }
        public void ResetSeq(object sender, RoutedEventArgs e)
        {
            if (!TMV.IsITX)
            {
                return;
            } 
        }
        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return; 
            base.Window_Loaded(sender, e);
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            if (dwMaster == null)
            {
                KEY = "";

            }
            else
            {
                KEY = TMV.MEKAGANG + TMV.MEKMTYP + TMV.MEKMNRKRS + TMV.MEKMLFDNR + TMV.MEKMPOS + TMV.MEKEVARHNR + TMV.MEKEVARUNR;
            }
        }
    }
    public partial class UIAE03
    {
        public VMEKOPF TMV
        {
            get
            {
                return (VMEKOPF)MV;
            }
        }
        #region ==KST===========
        public static readonly DependencyProperty KSTProperty = DependencyProperty.Register("KST",
            typeof(string), typeof(UIAE03),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnKSTChanged));
        public string KST
        {
            get
            {
                return (string)GetValue(KSTProperty);
            }
            set
            {
                SetValue(KSTProperty, value);
                OnKSTChg(value);
            }
        }
        private static void OnKSTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAE03;
            if (src != null)
            {
                src.KST = (string)e.NewValue;
            }
        }
        public virtual void OnKSTChg(string value)
        { }
        #endregion

        #region ==KSTKRS===========
        public static readonly DependencyProperty KSTKRSProperty = DependencyProperty.Register("KSTKRS",
            typeof(string), typeof(UIAE03),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnKSTKRSChanged));
        public string KSTKRS
        {
            get
            {
                return (string)GetValue(KSTKRSProperty);
            }
            set
            {
                SetValue(KSTKRSProperty, value);
                OnKSTKRSChg(value);
            }
        }
        private static void OnKSTKRSChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAE03;
            if (src != null)
            {
                src.KSTKRS = (string)e.NewValue;
            }
        }
        public virtual void OnKSTKRSChg(string value)
        { }
        #endregion

        #region ==AGANG===========
        public static readonly DependencyProperty AGANGProperty = DependencyProperty.Register("AGANG",
            typeof(string), typeof(UIAE03),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnAGANGChanged));
        public string AGANG
        {
            get
            {
                return (string)GetValue(AGANGProperty);
            }
            set
            {
                SetValue(AGANGProperty, value);
                OnAGANGChg(value);
            }
        }
        private static void OnAGANGChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAE03;
            if (src != null)
            {
                src.AGANG = (string)e.NewValue;
            }
        }
        public virtual void OnAGANGChg(string value)
        { }
        #endregion
        #region ==AMTYP===========
        public static readonly DependencyProperty AMTYPProperty = DependencyProperty.Register("AMTYP",
            typeof(string), typeof(UIAE03),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnAMTYPChanged));
        public string AMTYP
        {
            get
            {
                return (string)GetValue(AMTYPProperty);
            }
            set
            {
                SetValue(AMTYPProperty, value);
                OnAMTYPChg(value);
            }
        }
        private static void OnAMTYPChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAE03;
            if (src != null)
            {
                src.AMTYP = (string)e.NewValue;
            }
        }
        public virtual void OnAMTYPChg(string value)
        { }
        #endregion

        #region ==STDM===========
        public static readonly DependencyProperty STDMProperty = DependencyProperty.Register("STDM",
            typeof(string), typeof(UIAE03),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSTDMChanged));
        public string STDM
        {
            get
            {
                return (string)GetValue(STDMProperty);
            }
            set
            {
                SetValue(STDMProperty, value);
                OnSTDMChg(value);
            }
        }
        private static void OnSTDMChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAE03;
            if (src != null)
            {
                src.STDM = (string)e.NewValue;
            }
        }
        public virtual void OnSTDMChg(string value)
        { }
        #endregion

        #region ==MACHINEID===========
        public static readonly DependencyProperty MACHINEIDProperty = DependencyProperty.Register("MACHINEID",
            typeof(string), typeof(UIAE03),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnMACHINEIDChanged));
        public string MACHINEID
        {
            get
            {
                return (string)GetValue(MACHINEIDProperty);
            }
            set
            {
                SetValue(MACHINEIDProperty, value);
                OnMACHINEIDChg(value);
            }
        }
        private static void OnMACHINEIDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAE03;
            if (src != null)
            {
                src.MACHINEID = (string)e.NewValue;
            }
        }
        public virtual void OnMACHINEIDChg(string value)
        { }
        #endregion

        #region ==MMACHINES===========
        public static readonly DependencyProperty MMACHINESProperty = DependencyProperty.Register("MMACHINES",
            typeof(string), typeof(UIAE03),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnMMACHINESChanged));
        public string MMACHINES
        {
            get
            {
                return (string)GetValue(MMACHINESProperty);
            }
            set
            {
                SetValue(MMACHINESProperty, value);
                OnMMACHINESChg(value);
            }
        }
        private static void OnMMACHINESChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAE03;
            if (src != null)
            {
                src.MMACHINES = (string)e.NewValue;
            }
        }
        public virtual void OnMMACHINESChg(string value)
        { }
        #endregion

        #region ==IsByAM===========
        public static readonly DependencyProperty IsByAMProperty = DependencyProperty.Register("IsByAM",
            typeof(bool), typeof(UIAE03),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsByAMChanged));
        public bool IsByAM
        {
            get
            {
                return (bool)GetValue(IsByAMProperty);
            }
            set
            {
                SetValue(IsByAMProperty, value);
                OnIsByAMChg();
            }
        }
        private static void OnIsByAMChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAE03;
            if (src != null)
            {
                src.IsByAM = (bool)e.NewValue;
            }
        }
        public virtual void OnIsByAMChg()
        { }
        #endregion

        

    }
}
